package com.fcscs.cservice.client.main.configuration.iguest;


//import java.awt.Checkbox;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.IconButtonEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.fcscs.core.common.authority.CServiceAuthority;
import com.fcscs.core.common.authority.UserAuthority;
import com.fcscs.core.domain.IdNameModel;
import com.fcscs.core.domain.Property;
import com.fcscs.core.gwt.common.AsyncCallbackListener;
import com.fcscs.core.gwt.common.CoreConstants;
import com.fcscs.core.gwt.common.SessionContext;
import com.fcscs.core.gwt.common.ui.CenteredInfo;
import com.fcscs.core.gwt.common.ui.FcsFields.EasyClearCombobox;
import com.fcscs.core.gwt.common.ui.FcsFields.FormButton;
import com.fcscs.core.gwt.common.ui.FcsFields.HighLightIconButton;
import com.fcscs.core.gwt.common.ui.FcsPanel;
import com.fcscs.cservice.client.common.CServiceConstants;
import com.fcscs.cservice.client.common.UIUtils;
import com.fcscs.cservice.client.common.controller.CServiceCommonServiceController;
import com.fcscs.cservice.client.common.model.configuration.reservation.PropertyIdNameModelData;
import com.fcscs.cservice.domain.DedicatedVideoConfig;
import com.fcscs.share.gwt.common.ShareGWTConstants;
import com.fcscs.share.gwt.common.ui.MultiLanguageDialog;
import com.fcscs.share.gwt.common.ui.MultiLanguageTextArea;
import com.fcscs.share.gwt.common.ui.event.MultiLanguageDialogEventHandler;
import com.fcscs.share.gwt.common.ui.event.MultiLanguageDialogOKEvent;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;

public class DelicatedVideoPanel extends FcsPanel {
	private VerticalPanel vp;
	private TextField<String> reservationSearchDaysField;
	
	private EasyClearCombobox<PropertyIdNameModelData> propCombox;
	private ListStore<PropertyIdNameModelData> propListStore;
	private List<IdNameModel<Property>> propGroupIdNames;
	
	
	private TextField<String> netTextField;
	private TextField<String> loginpTextField;
	private TextField<String> loginiTextField;
	private TextField<String> serviceTextField;
	private TextArea newmesnotTextArea;
	private Label l2;
	private DedicatedVideoConfig currentDelicatedVideoConf;
	public FieldSet fieldSet1;
	
	
	private PropertyIdNameModelData currentProperty;
	private iGuestLoginOptionDialog dialog = iGuestLoginOptionDialog.getInstance();
	private PrecheckinDialog predialog = PrecheckinDialog.getInstance();
	//private iGuestUsersModelData currentTestModel;
	
	public DelicatedVideoPanel(String id) {
		super(id);
		//dialog.addHandler(this, DialogEvent.TYPE);
		//predialog.addHandler(this, PrecheckinDialogEvent.TYPE);
	}
	private Validator tandcValidator = new Validator() {
		@Override
		public String validate(Field<?> field, final String value) {
			if(value != null && !value.trim().isEmpty() && UIUtils.getCharCount(value.trim()) > 2048){
				return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(CServiceConstants.CSERVICE_CONSTANTS.termsAndConditions(), 2048);
			}

			return null;
		}
	};
	@Override
	public void init() {
		vp = new VerticalPanel();
		vp.setId("PropertyConfigPanel_vpPanel");
		vp.setSpacing(5);
		
		LayoutContainer lc = new LayoutContainer();
		lc.setId("PropertyConfigPanel_lc");
		lc.setLayout(new ColumnLayout());
		
		Label propLabel = new Label(CoreConstants.CORE_CONSTANTS.property() + CoreConstants.REQURIED_FIELD_LABEL);
		propLabel.setId("PropertyConfigPanel_propLabel");
		
		propListStore = new ListStore<PropertyIdNameModelData>();
		propCombox = new EasyClearCombobox<PropertyIdNameModelData>();
		propCombox.setId("PropertyConfigPanel_propCombox");
//		propCombox.setFieldLabel(CoreConstants.CORE_CONSTANTS.property());
		propCombox.setWidth(200);
		propCombox.setDisplayField(CoreConstants.FULLTNAME);
		propCombox.setAllowBlank(false);
		propCombox.setForceSelection(true);
		propCombox.setTriggerAction(TriggerAction.ALL);
		propCombox.setStore(propListStore);
		propCombox.addSelectionChangedListener(new SelectionChangedListener<PropertyIdNameModelData>(){
			@Override
			public void selectionChanged(
					SelectionChangedEvent<PropertyIdNameModelData> se) {
//				myClear();
//				CServiceCommonServiceController.getINSTANCE().getDelicatedVideo(
//						propCombox.getValue().getEntity().getId(), 
//						new AsyncCallbackListener<DelicatedVideoConfig>(){
//							@Override
//							public void onLogin(String username) {
//								CServiceCommonServiceController.getINSTANCE().getDelicatedVideo(
//									propCombox.getValue().getEntity().getId(),this);
//							}
//
//							@Override
//							public void onFailure(Throwable caught) {
//								MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
//									CoreConstants.CORE_CONSTANTS.systemError(), null);
//							}
//
//							@Override
//							public void onSuccess(DelicatedVideoConfig result) {
//								if(null != result){
////									currentPropConf = result;
//									//reservationSearchDaysField.setValue(result.getReservationSearchDays() + "");
//								}
//								//currentDelicatedVideoConf.setLoginOption(loginopTextField.getValue() == null ? null : loginopTextField.getValue().trim());
//								currentDelicatedVideoConf.setUsername(eUsernameTextField.getValue() == null ? null : eUsernameTextField.getValue().trim());
//								currentDelicatedVideoConf.setPassword(passwordTextField.getValue() == null ? null : passwordTextField.getValue().trim());
//							}
//							
//						});
			}
		});
		
		lc.add(propLabel, new ColumnData(70));
		lc.add(propCombox, new ColumnData(160));
		
		vp.add(lc);		
		
		FormPanel panel = new FormPanel();
		panel.setId("RCConfigPanel_panel");
		panel.setFrame(true);
		panel.setHeading(CServiceConstants.CSERVICE_CONSTANTS.delicatedvideo());
		panel.setPadding(10);
		panel.setSize(730, 400);
		panel.setLabelAlign(LabelAlign.LEFT);
		panel.setLabelSeparator("");
		panel.setLabelWidth(200);
		panel.setFieldWidth(400);
		
// Them LayoutContainer Login Option
		VerticalPanel lca = new VerticalPanel();
		lca.setBorders(true);
		lca.setSpacing(5);
		
		HorizontalPanel lcab = new HorizontalPanel();
		Label l = new Label(CServiceConstants.CSERVICE_CONSTANTS.newvideo());
		//l.setStyleAttribute("marginLeft", "5px");
		
		//Checkbox newvideoactive=new Checkbox();
		final CheckBox newvideoactive=new CheckBox();
		newvideoactive.setBoxLabel(CServiceConstants.CSERVICE_CONSTANTS.activevideo());
		
		lca.add(l);
		lca.add(newvideoactive);
	    lca.add(lcab);
	    panel.add(lca);
	    

	        
// Them LayoutContainer Popup Configuration
	    fieldSet1=new FieldSet();
	    fieldSet1.setWidth(700);
		fieldSet1.setBorders(true);
		//fieldSet1.set
		fieldSet1.setId("DedicatedVideoPanel_fieldSet1");
		fieldSet1.setStyleAttribute(CServiceConstants.CSS_MARGINTOP, "15px");
		fieldSet1.setHeading(CServiceConstants.CSERVICE_CONSTANTS.popupconfig()
				+ CoreConstants.REQURIED_FIELD_LABEL);

	
			Label lnet = new Label(CServiceConstants.CSERVICE_CONSTANTS.videomessage());
			//lcpopup.add(lnet);
///MultiLanguage
	    final Label dialogTestValueLabel = new Label("Value");
	   	final MultiLanguageDialog testDialog = new MultiLanguageDialog();
	   	testDialog.setAllowBlank(false);
	   	testDialog.addMultiLanguageDialogEventHandler(new MultiLanguageDialogEventHandler() {

		@Override
		public void onButtonOKClicked(
				MultiLanguageDialogOKEvent event) {
			// Get map language-text
			Map<String, String> values = event.getSource()
					.getLanguageTexts();

			// Display English in label
			serviceTextField.setValue(values
					.get(MultiLanguageDialog.DEFAULT_LANGUAGE));
			
			}
	   	});
	//Edit icon for MultiLanguage
		final HighLightIconButton dialogTestButton = new HighLightIconButton(
				ShareGWTConstants.CSS_EDIT_SM_ICON,
				new SelectionListener<IconButtonEvent>() {
					@Override
					public void componentSelected(IconButtonEvent ce) {
						testDialog.show();
					}
				});			
			HorizontalPanel net=new HorizontalPanel();
			final MultiLanguageTextArea ta = new MultiLanguageTextArea();
			ta.setDialogTitle("Sample text area");
			ta.setFieldLabel("Sample text area");
			ta.setAllowBlank(false);
			netTextField = new TextField<String>();
	        netTextField.setId("InterfaceConfigPanel_levelTextField");
	        netTextField.setWidth(600);
	        netTextField.setStyleAttribute(CServiceConstants.CSS_MARGINBUTTOM, "15px");
	        netTextField.setValidator(new Validator(){
				@Override
				public String validate(Field<?> field, String value) {
					if(value != null 
					   && !value.trim().isEmpty()
					   && value.trim().length() > 255){
						return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
								CServiceConstants.CSERVICE_CONSTANTS.webServiceURL(), 255);
					}
					return null;
				}
	        });
			//net.add(ta);
	        net.add(netTextField);
	        //HighLightIconButton id = MultiEditBtn();
	        net.add(dialogTestButton);
	        //lcpopup.add(net);
	        
	        Label logp = new Label(CServiceConstants.CSERVICE_CONSTANTS.videonotavailable());
	        logp.setStyleAttribute(CServiceConstants.CSS_MARGINTOP, "10px");
			//lcpopup.add(logp);
	       
			HorizontalPanel loginp=new HorizontalPanel();
			Map<String, String> testValue = new HashMap<String, String>();
			testValue.put("en_us", "English");
			testValue.put("ja", "Japanese");

			loginpTextField = new TextField<String>();
			loginpTextField.setWidth(600);
			loginpTextField.setStyleAttribute(CServiceConstants.CSS_MARGINBUTTOM, "15px");
	        loginpTextField.setId("InterfaceConfigPanel_loginpTextField");
	        loginpTextField.setValidator(new Validator(){
				@Override
				public String validate(Field<?> field, String value) {
					if(value != null 
					   && !value.trim().isEmpty()
					   && value.trim().length() > 255){
						return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
								CServiceConstants.CSERVICE_CONSTANTS.webServiceURL(), 255);
					}
					return null;
				}
	        });
			//loginp.add(tf);
	        loginp.add(loginpTextField);
	       // HighLightIconButton ie = MultiEditBtn();
	        loginp.add(dialogTestButton);
	        //lcpopup.add(loginp);
	        
	        Label logi = new Label(CServiceConstants.CSERVICE_CONSTANTS.videofrom());
	        logi.setStyleAttribute(CServiceConstants.CSS_MARGINTOP, "10px");
			//lcpopup.add(logi);
	       
			HorizontalPanel logini=new HorizontalPanel();
			loginiTextField = new TextField<String>();
			loginiTextField.setWidth(600);
			loginiTextField.setStyleAttribute(CServiceConstants.CSS_MARGINBUTTOM, "15px");
	        loginiTextField.setId("InterfaceConfigPanel_loginiTextField");
	        loginiTextField.setValidator(new Validator(){
				@Override
				public String validate(Field<?> field, String value) {
					if(value != null 
					   && !value.trim().isEmpty()
					   && value.trim().length() > 255){
						return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
								CServiceConstants.CSERVICE_CONSTANTS.webServiceURL(), 255);
					}
					return null;
				}
	        });
	        logini.add(loginiTextField);
	
	        logini.add(dialogTestButton);
	        //lcpopup.add(logini);
	        
	        Label serv = new Label(CServiceConstants.CSERVICE_CONSTANTS.videosubject());
			//lcpopup.add(serv);
	       
			HorizontalPanel servp=new HorizontalPanel();
			serviceTextField = new TextField<String>();
			serviceTextField.setWidth(600);
			serviceTextField.setStyleAttribute(CServiceConstants.CSS_MARGINBUTTOM, "15px");
			serviceTextField.setId("InterfaceConfigPanel_serviceTextField");
			serviceTextField.setValidator(new Validator(){
				@Override
				public String validate(Field<?> field, String value) {
					if(value != null 
					   && !value.trim().isEmpty()
					   && value.trim().length() > 255){
						return ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(
								CServiceConstants.CSERVICE_CONSTANTS.webServiceURL(), 255);
					}
					return null;
				}
	        });
	        servp.add(serviceTextField);
	        //HighLightIconButton ig = MultiEditBtn();
	        servp.add(dialogTestButton);
	        //lcpopup.add(servp);
	        
	        Label newmsnoti = new Label(CServiceConstants.CSERVICE_CONSTANTS.messagenotification());
	        newmsnoti.setStyleAttribute(CServiceConstants.CSS_MARGINTOP, "10px");
	        HorizontalPanel newmeshp=new HorizontalPanel();
	        
	        newmesnotTextArea = new TextArea();
	        newmesnotTextArea.setId("PropertyConfigPanel_Name_tandcArea");
	        newmesnotTextArea.setHeight(60);
	        newmesnotTextArea.setWidth(600);
	        newmesnotTextArea.setValidator(tandcValidator);
	        newmesnotTextArea.addListener(Events.OnBlur,new Listener<FieldEvent>() {
				@Override
				public void handleEvent(FieldEvent be) {
					String value = newmesnotTextArea.getValue();
					if(value != null && !value.trim().isEmpty() && UIUtils.getCharCount(value.trim()) > 2048){
						newmesnotTextArea.forceInvalid(ShareGWTConstants.SHARE_GWT_MESSAGES.outOfLength(CServiceConstants.CSERVICE_CONSTANTS.termsAndConditions(), 2048));
						return;
					}else{
						newmesnotTextArea.clearInvalid();
						return;
					}
				}
			});
	        newmeshp.add(newmesnotTextArea);

	        fieldSet1.add(lnet);
	        fieldSet1.add(net);
	        fieldSet1.add(logp);
	        fieldSet1.add(loginp);
	        fieldSet1.add(logi);
	        fieldSet1.add(logini);
	        fieldSet1.add(serv);
	        fieldSet1.add(servp);
	        fieldSet1.add(newmsnoti);	
	        fieldSet1.add(newmeshp);
			panel.add(fieldSet1);
			
		reservationSearchDaysField = new TextField<String>();
		reservationSearchDaysField.setId("PropertyConfigPanel_Name_reservationSearchDaysField");
		reservationSearchDaysField.setFieldLabel(CServiceConstants.CSERVICE_CONSTANTS.reservationSearchDays() + CoreConstants.REQURIED_FIELD_LABEL);
		//reservationSearchDaysField.setValidator(reservationSearchDaysValidator);
		reservationSearchDaysField.setAllowBlank(false);

		
		vp.add(panel);
/// Nut Save
		FormButton saveButton = new FormButton(CoreConstants.CORE_CONSTANTS.save());
	    saveButton.setId("AuthenConfigPanel_saveButton");
	    saveButton.setStyleAttribute(CServiceConstants.CSS_MARGINLEFT, "560px");
		saveButton.setSize(60, 30);
		saveButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
			@Override
			public void componentSelected(ButtonEvent ce) {
				Window.alert("save button click");
				currentDelicatedVideoConf=new DedicatedVideoConfig();
				//currentDelicatedVideoConf.setId(1);
				currentDelicatedVideoConf.setPropertyId(1);
				currentDelicatedVideoConf.setOrgId(1);
				currentDelicatedVideoConf.setNewVideoNotificationActivation(true);
				currentDelicatedVideoConf.setCreated(new Date());
				currentDelicatedVideoConf.setUpdated(new Date());
				currentDelicatedVideoConf.setCreatedBy(0);
				currentDelicatedVideoConf.setUpdatedBy(0);
				Window.alert("Beginning to save");
				saveDelicatedVideoConf(currentDelicatedVideoConf);
//				if(loginopTextField.isValid()
//				   && eUsernameTextField.isValid()
//				   && passwordTextField.isValid()){
//					CServiceCommonServiceController.getINSTANCE().getDelicatedVideo(
//							propCombox.getValue().getEntity().getId(), 
//							new AsyncCallbackListener<DelicatedVideoConfig>(){
//								@Override
//								public void onLogin(String username) {
//									CServiceCommonServiceController.getINSTANCE().getDelicatedVideo(
//										propCombox.getValue().getEntity().getId(),this);
//								}
//
//								@Override
//								public void onFailure(Throwable caught) {
//									MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
//										CoreConstants.CORE_CONSTANTS.systemError(), null);
//								}
//
//								@Override
//								public void onSuccess( DelicatedVideoConfig result) {
//									if(null == result){
//										currentDelicatedVideoConf = new DelicatedVideoConfig();
//										currentDelicatedVideoConf.setOrgId(SessionContext.getInstance().getOrgId());
//										currentDelicatedVideoConf.setPropertyId(propCombox.getValue().getEntity().getId());
//									}else{
//										currentDelicatedVideoConf = result;
//									}
//									//if(loginopTextField.getValue()){}
//									//currentDelicatedVideoConf.setLoginOption(loginopTextField.getValue());
//									currentDelicatedVideoConf.setUsername(eUsernameTextField.getValue());
//									currentDelicatedVideoConf.setPassword(passwordTextField.getValue());
//									
//									saveDelicatedVideoConf(currentDelicatedVideoConf);
//								}
//								
//							});
//				}
				
				
			}
		});
        vp.add(saveButton);
  
      
   		// Get Map of Language
   				// Keep in mine we must set Map of Languages for Dialog, TextField, TextArea in method onSuccess
   				CServiceCommonServiceController.getINSTANCE().getLanguageMap(
   						new AsyncCallbackListener<Map<String, String>>() {

   							@Override
   							public void onLogin(String username) {
   								CServiceCommonServiceController.getINSTANCE()
   										.getLanguageMap(this);
   							}

   							@Override
   							public void onSuccess(Map<String, String> result) {
   								final Map<String, String> languages = result;
   								testDialog.setLanguages(languages);
   								
   							}

   							@Override
   							public void onFailure(Throwable caught) {
   								Info.display("failure", caught.getMessage());
   							}
   						});
   			

//ket thuc khai bao Multilanguage				
		add(vp);
		onShow();
	}

	@Override
	public UserAuthority getRequiredAuthority() {
		return CServiceAuthority.cSERVICE_CONFIG;
	}

	@Override
	protected Widget getViewPanel() {
		return vp;
	}

	@Override
	public void onShow() {
		loadProperty();
		myClear();
		//Window.alert("property id = " + SessionContext.getInstance().getPropertyId());
		CServiceCommonServiceController.getINSTANCE().getDelicatedVideo(SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(), new AsyncCallbackListener<DedicatedVideoConfig>(){

				@Override
				public void onLogin(String username) {
					CServiceCommonServiceController.getINSTANCE().getDelicatedVideo(
						SessionContext.getInstance().getPropertyId(),SessionContext.getInstance().getOrgId(),this);
				}

				@Override
				public void onFailure(Throwable caught) {
					MessageBox.alert(CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), null);
				}

				@Override
				public void onSuccess(DedicatedVideoConfig result) {
					if(null != result){}
				}
				
			});

	}

	@Override
	public boolean onHide() {
		myClear();
		return true;
	}

	private void myClear() {
		reservationSearchDaysField.clear();
	}
///	
	private void saveDelicatedVideoConf(final DedicatedVideoConfig conf){
		if(currentDelicatedVideoConf.getNewVideoNotificationActivation() == null)
		{
			Window.alert("NewVideoNotificationActivation = null");
			
		}
		Window.alert("into Save");
		CServiceCommonServiceController.getINSTANCE().saveDelicatedVideo(conf, new AsyncCallbackListener<DedicatedVideoConfig>(){

				@Override
				public void onLogin(String username) {
					CServiceCommonServiceController.getINSTANCE().saveDelicatedVideo(
						conf,this);
					Window.alert("onlogin");
				}
				
				@Override
				public void onFailure(Throwable caught) {
					Window.alert("onfail");
					MessageBox.alert(
						CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
						CoreConstants.CORE_CONSTANTS.systemError(), 
						null);
				}
				@Override
				public void onSuccess(DedicatedVideoConfig result) {
					if(result != null){
						CenteredInfo.displayCompleted(CoreConstants.CORE_CONSTANTS.edited());
					}else{
						MessageBox.alert(
								CoreConstants.CORE_MESSAGES.operation(CoreConstants.CORE_CONSTANTS.system(), ShareGWTConstants.SHARE_GWT_CONSTANTS.error()),
								CoreConstants.CORE_CONSTANTS.systemError(), 
								null);
					}
				}
			});
	}
	


	@Override
	public void setFocus() {
	}
	
	private void loadProperty() {
		propGroupIdNames = SessionContext.getInstance().getPropertyGroup();
		propListStore.removeAll();
		if (0 != propGroupIdNames.size()) {
			int propIndex = 0;
			for (IdNameModel<Property> inm : propGroupIdNames) {
				propListStore.add(new PropertyIdNameModelData(inm));
				if (propIndex == 0) {
					if (SessionContext.getInstance().getPropertyId() == inm.getId()) {
						propIndex = propListStore.getCount() - 1;
					}
				}
			}
			propCombox.setValue(propListStore.getAt(propIndex));
		} else {
			IdNameModel<Property> tempINM = new IdNameModel<Property>(SessionContext.getInstance().getPropertyId(), SessionContext.getInstance().getPropertyName());
			propListStore.add(new PropertyIdNameModelData(tempINM));
			propCombox.setValue(propListStore.getAt(0));
		}
	}

	  public HighLightIconButton createEditBtn() {
			HighLightIconButton iconBtn = new HighLightIconButton(
					ShareGWTConstants.CSS_EDIT_SM_ICON,
					new SelectionListener<IconButtonEvent>() {
						@Override
						public void componentSelected(IconButtonEvent ce) {
							dialog.show();
						}
					});
			iconBtn.setTitle(CoreConstants.CORE_CONSTANTS.edit());
			return iconBtn;
		}

/// Pre checkin Edit Button
	  public HighLightIconButton createPreEditBtn() {
			HighLightIconButton iconBtn = new HighLightIconButton(
					ShareGWTConstants.CSS_EDIT_SM_ICON,
					new SelectionListener<IconButtonEvent>() {
						@Override
						public void componentSelected(IconButtonEvent ce) {
							//predialog = PrecheckinDialog.getInstance();
							predialog.show();
						}
					});
			iconBtn.setTitle(CoreConstants.CORE_CONSTANTS.edit());
			return iconBtn;
		}



}
